import { defineUserConfig } from "vuepress";
import recoTheme from "vuepress-theme-reco";
import tabsPlugin from "@snippetors/vuepress-plugin-tabs";

export default defineUserConfig({
  title: "前端面试宝典",
  description: "前端面试题汇总",
  base: "/interview/",
  theme: recoTheme({
    logo: "/logo.png",
    author: "xiongjian",
    docsRepo: "https://gitee.com/xxpromise/interview",
    docsBranch: "master",
    docsDir: "/",
    lastUpdatedText: "最后更新时间",
    // series 为原 sidebar
    catalogTitle: "大纲",
    series: {
      "/docs": [
        "html",
        "css",
        "javascript",
        "coding",
        "node",
        "http",
        "builder",
        "react",
        "vue",
        "mobile",
        "miniprogrem",
        "project",
        "other",
      ],
    },
    navbar: [
      {
        text: "面试题库",
        children: [
          { text: "HTML", link: "/docs/html" },
          { text: "CSS", link: "/docs/css" },
          { text: "JavaScript", link: "/docs/javascript" },
          { text: "手写代码", link: "/docs/coding" },
          { text: "NodeJS", link: "/docs/node" },
          { text: "网络", link: "/docs/http" },
          { text: "工程化", link: "/docs/builder" },
          { text: "React", link: "/docs/react" },
          { text: "Vue", link: "/docs/vue" },
          { text: "移动端", link: "/docs/mobile" },
          { text: "小程序", link: "/docs/miniprogrem" },
          { text: "项目", link: "/docs/project" },
          { text: "扩展", link: "/docs/other" },
        ],
        icon: "Compass",
      },
      { text: "留言板", link: "/message-board", icon: "Chat" },
    ],
    // 评论
    commentConfig: {
      type: "valine",
      options: {
        appId: "iw1D0ENttamQeJ7e9lFiRKTc-9Nh9j0Va", // your appId
        appKey: "mnHtZOz4e2qdByOP1hWo9ep1", // your appKey
        hideComments: true, // 全局隐藏评论，默认 false
      },
    },
    // 公告
    bulletin: {
      body: [
        {
          type: "text",
          content: `🎉🎉🎉 
          前端面试宝典更新ing。
          欢迎大家查看与反馈。`,
          style: "font-size: 16px;",
        },
        { type: "hr" },
        { type: "title", content: "注意" },
        {
          type: "text",
          content: `因为缓存的原因，大家可能需要刷新浏览器才能看到最新的内容！`,
          style: "font-size: 14px;",
        },
        { type: "hr" },
        { type: "title", content: "更新进度" },
        {
          type: "text",
          content: `
          <ul>
            <li><a href="/interview/docs/html.html">HTML [√]</li>
            <li><a href="/interview/docs/css.html">CSS [√]</li>
            <li><a href="/interview/docs/javascript.html">JavaScript [√]</li>
            <li><a href="/interview/docs/coding.html">手写代码 [√]</li>
            <li><a href="/interview/docs/node.html">NodeJS [x]</li>
            <li><a href="/interview/docs/http.html">网络 [√]</li>
            <li><a href="/interview/docs/builder.html">工程化 [√]</li>
            <li><a href="/interview/docs/react.html">React [√]</li>
            <li><a href="/interview/docs/vue.html">Vue [x]</li>
            <li><a href="/interview/docs/miniprogrem.html">小程序 [x]</li>
            <li><a href="/interview/docs/project.html">项目 [x]</li>
            <li><a href="/interview/docs/other.html">扩展 [x]</li>
          </ul>`,
          style: "font-size: 12px;",
        },
        { type: "hr" },
        { type: "title", content: "Gitee" },
        {
          type: "text",
          content: `
          <ul>
            <li><a href="https://gitee.com/xxpromise/interview/issues">反馈渠道 Issues<a/></li>
            <li><a href="/interview/message-board.html">留言<a/></li>
          </ul>`,
          style: "font-size: 14px;",
        },
      ],
    },
  }),
  plugins: [tabsPlugin(["event1"])],
});
